package debug_;

public class DebugExercise {
    public static void main(String[] args) {

        Person jack = new Person("jack", 10);//F7或Alt+Shift+F7
        System.out.println(jack);
        //创建对象的流程
        //(1)加载Person类信息
        //(2)初始化 2.1默认初始化 2.2显示初始化 2.3构造器初始化
        //(3)返回对象地址
    }
}
class Person {
    private String name;//默认null
    private int age;//默认0

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    //重写toString 产生对象的属性

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
